/**
 * Main application module
 */
var app = {
	// Module names list
	_modules : [],
	
	/**
	 * Application init
	 */
	init : function() {
		var that = this;
		
		this.initModules();
	},
	
	/**
	 * Init modules
	 */
	initModules : function() {
		if (!this._modules || !this._modules.length) {
			return false;
		}
		
		for (var i = 0; i < this._modules.length; i++) {
			this[this._modules[i]].init && this[this._modules[i]].init();
		}
	},
	
	/**
	 * Register modules
	 * Adds module names to the list for further initialization
	 */
	register : function() {
		for (var i = 0; i < arguments.length; i++) {
			this._modules.push(arguments[i]);
		}
	}
};

/**
 * A namespace for different base objects
 */
app.base = {};